import { Controller } from '@nestjs/common';
import { AuthService } from './auth.service';

@Controller('auth')
export class AuthController {
  constructor(private authService: AuthService) {}

  // @UseGuards(AuthGuard('local'))
  // @Post('login')
  // async login(@Body() credentials: { username: string; password: string }) {
  //   const { username, password } = credentials;
  //   return this.authService.login({ username, password });
  // }

  // @Get('userInfo')
  // async getUserInfo(@Req() req: Request) {
  //   const token = req.headers.authorization?.replace('Bearer ', '');
  //   if (!token) {
  //     throw new UnauthorizedException('未提供令牌');
  //   }
  //   // console.log(this.authService.getUserInfo(token), '----token');
  //   return {
  //     auths: ['*', 'member', 'lowcode', 'addlowcode'],
  //   };
  // }
}
